package com.threadExample;

/**
 * Created by yijy on 2017/7/21.
 */
public class ThreadTest2 {
    public int j=100;
    public static void main(String[] args) {
        for(int i=0;i<20;i++){
            Thread test2 = new Thread(new print());
            test2.start();
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            new ThreadTest2().j=120;
        }
    }

    public void test1(int a){
        System.out.println(a);
    }
}

class print implements Runnable{
    @Override
    public void run() {
        new ThreadTest2().test1(new ThreadTest2().j);
    }
}